package com.cskaoyan.wx.controller;

import com.cskaoyan.vo.BaseRespVo;
import com.cskaoyan.wx.bean.vo.WxTopicDetailVo;
import com.cskaoyan.wx.bean.vo.WxTopicRelatedVo;
import com.cskaoyan.wx.bean.vo.WxTopicVo;
import com.cskaoyan.wx.service.WxTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 作者：whl
 * 功能：
 */
@RestController
public class WxTopicController {
    @Autowired
    WxTopicService wxTopicService;

    /**
     * by:whl
     * 功能：list【get】
     * @param page
     * @param size
     * @return
     */
    @RequestMapping("wx/topic/list")
    public BaseRespVo topicList(Integer page,Integer size){//?page=1&size=10
        WxTopicVo topicVo = wxTopicService.topList(page,size);
        return BaseRespVo.ok(topicVo);
    }

    /**
     * by:whl
     * 功能：detail【get】
     * @param id
     * @return
     */
    @RequestMapping("wx/topic/detail")
    public BaseRespVo topicDetail(Integer id){//?id=264
        WxTopicDetailVo detailVo = wxTopicService.topicDetail(id);
        return BaseRespVo.ok(detailVo);
    }

    /**
     * by:whl
     * 功能：related【get】
     * @param id
     * @return
     */
    @RequestMapping("wx/topic/related")
    public BaseRespVo topicRelated(Integer id){//?id=264
        WxTopicRelatedVo relatedVo = wxTopicService.topicRelated(id);
        return BaseRespVo.ok(relatedVo);
    }
}
